﻿using Microsoft.AspNetCore.Http;

using System.Security.Claims;
using System.Security.Principal;

namespace WXWorkSvc.Common.Extensions;

public static class RequestExtensions
{
    public static bool IsWXBrowse(this HttpRequest request)
    {
        return request.Headers["User-Agent"].ToString().ToLower().Contains("micromessenger");
    }
    //public static bool IsMobile(this HttpRequest request)
    //{
    //    return request.Headers["User-Agent"].ToString().ToLower().Contains("mobile");
    //}
    //public static string GetClaimValue(this ClaimsPrincipal user, string name)
    //{
    //    return ((ClaimsIdentity)user.Identity!).FindFirst(name)!.Value!;
    //}
}
